Optimal. Leaf size=83 \[ -b \left (3 a^2-b^2\right ) x-\frac {5 a^2 b \cot (c+d x)}{2 d}-\frac {a \left (a^2-3 b^2\right ) \log (\sin (c+d x))}{d}-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3646, 3709,
3612, 3556} \begin {gather*} -\frac {a \left (a^2-3 b^2\right ) \log (\sin (c+d x))}{d}-b x \left (3 a^2-b^2\right )-\frac {5 a^2 b \cot (c+d x)}{2 d}-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3612
Rule 3646
Rule 3709
Rubi steps
\begin {align*} \int \cot ^3(c+d x) (a+b \tan (c+d x))^3 \, dx &=-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))}{2 d}+\frac {1}{2} \int \cot ^2(c+d x) \left (5 a^2 b-2 a \left (a^2-3 b^2\right ) \tan (c+d x)-b \left (a^2-2 b^2\right ) \tan ^2(c+d x)\right ) \, dx\\ &=-\frac {5 a^2 b \cot (c+d x)}{2 d}-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))}{2 d}+\frac {1}{2} \int \cot (c+d x) \left (-2 a \left (a^2-3 b^2\right )-2 b \left (3 a^2-b^2\right ) \tan (c+d x)\right ) \, dx\\ &=-b \left (3 a^2-b^2\right ) x-\frac {5 a^2 b \cot (c+d x)}{2 d}-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))}{2 d}-\left (a \left (a^2-3 b^2\right )\right ) \int \cot (c+d x) \, dx\\ &=-b \left (3 a^2-b^2\right ) x-\frac {5 a^2 b \cot (c+d x)}{2 d}-\frac {a \left (a^2-3 b^2\right ) \log (\sin (c+d x))}{d}-\frac {a^2 \cot ^2(c+d x) (a+b \tan (c+d x))}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.33, size = 96, normalized size = 1.16 \begin {gather*} \frac {-6 a^2 b \cot (c+d x)-a^3 \cot ^2(c+d x)+(a+i b)^3 \log (i-\tan (c+d x))-2 a \left (a^2-3 b^2\right ) \log (\tan (c+d x))+(a-i b)^3 \log (i+\tan (c+d x))}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.21, size = 74, normalized size = 0.89
method | result | size |
derivativedivides | \(\frac {a^{3} \left (-\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\sin \left (d x +c \right )\right )\right )+3 a^{2} b \left (-\cot \left (d x +c \right )-d x -c \right )+3 b^{2} a \ln \left (\sin \left (d x +c \right )\right )+b^{3} \left (d x +c \right )}{d}\) | \(74\) |
default | \(\frac {a^{3} \left (-\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\sin \left (d x +c \right )\right )\right )+3 a^{2} b \left (-\cot \left (d x +c \right )-d x -c \right )+3 b^{2} a \ln \left (\sin \left (d x +c \right )\right )+b^{3} \left (d x +c \right )}{d}\) | \(74\) |
norman | \(\frac {\left (-3 a^{2} b +b^{3}\right ) x \left (\tan ^{2}\left (d x +c \right )\right )-\frac {a^{3}}{2 d}-\frac {3 a^{2} b \tan \left (d x +c \right )}{d}}{\tan \left (d x +c \right )^{2}}-\frac {a \left (a^{2}-3 b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )}{d}+\frac {a \left (a^{2}-3 b^{2}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) | \(103\) |
risch | \(-3 a^{2} b x +b^{3} x +i a^{3} x -3 i a \,b^{2} x +\frac {2 i a^{3} c}{d}-\frac {6 i a \,b^{2} c}{d}+\frac {2 a^{2} \left (a \,{\mathrm e}^{2 i \left (d x +c \right )}-3 i b \,{\mathrm e}^{2 i \left (d x +c \right )}+3 i b \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}-\frac {a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}+\frac {3 a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) b^{2}}{d}\) | \(141\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.53, size = 92, normalized size = 1.11 \begin {gather*} -\frac {2 \, {\left (3 \, a^{2} b - b^{3}\right )} {\left (d x + c\right )} - {\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 2 \, {\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\tan \left (d x + c\right )\right ) + \frac {6 \, a^{2} b \tan \left (d x + c\right ) + a^{3}}{\tan \left (d x + c\right )^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.35, size = 99, normalized size = 1.19 \begin {gather*} -\frac {6 \, a^{2} b \tan \left (d x + c\right ) + {\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )^{2} + a^{3} + {\left (a^{3} + 2 \, {\left (3 \, a^{2} b - b^{3}\right )} d x\right )} \tan \left (d x + c\right )^{2}}{2 \, d \tan \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.95, size = 146, normalized size = 1.76 \begin {gather*} \begin {cases} \tilde {\infty } a^{3} x & \text {for}\: \left (c = 0 \vee c = - d x\right ) \wedge \left (c = - d x \vee d = 0\right ) \\x \left (a + b \tan {\left (c \right )}\right )^{3} \cot ^{3}{\left (c \right )} & \text {for}\: d = 0 \\\frac {a^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - \frac {a^{3} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} - \frac {a^{3}}{2 d \tan ^{2}{\left (c + d x \right )}} - 3 a^{2} b x - \frac {3 a^{2} b}{d \tan {\left (c + d x \right )}} - \frac {3 a b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {3 a b^{2} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + b^{3} x & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 171 vs.
\(2 (79) = 158\).
time = 1.25, size = 171, normalized size = 2.06 \begin {gather*} -\frac {a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 8 \, {\left (3 \, a^{2} b - b^{3}\right )} {\left (d x + c\right )} - 8 \, {\left (a^{3} - 3 \, a b^{2}\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right ) + 8 \, {\left (a^{3} - 3 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - \frac {12 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 36 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.07, size = 102, normalized size = 1.23 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,\left (3\,a\,b^2-a^3\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,{\left (a+b\,1{}\mathrm {i}\right )}^3}{2\,d}-\frac {{\mathrm {cot}\left (c+d\,x\right )}^2\,\left (\frac {a^3}{2}+3\,b\,\mathrm {tan}\left (c+d\,x\right )\,a^2\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,{\left (b+a\,1{}\mathrm {i}\right )}^3\,1{}\mathrm {i}}{2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________